package cn.edu.tju.core.model;

public enum ResultCodeEnum {
    /*** 通用部分 100 - 599***/
    // 成功请求
    SUCCESS("OK", "successful"),
    // 资源未找到
    NOT_FOUND("NOT_FOUND", "not found"),
    // 服务器错误
    SERVER_ERROR("GENERAL_ERROR","server error"),
    // 权限不足
    NOT_AUTHORIZED("NOT_AUTHORIZED","not authorized"),
    // 用户不存在
    USER_NOT_FOUND("USER_NOT_FOUND","user not found" ),
    // 无金额 无法生成订单
    PRICE_NOT_ENOUGH("PRICE_NOT_ENOUGH", "price not enough"),

    BUSINESS_NOT_FOUND(" BUSINESS_NOT_FOUND"," BUSINESS_NOT_FOUND" ),

    PARAM_ERROR( "PARAM_ERROR",  "PARAM_ERROR"),
    BUSINESS_EXISTS(" BUSINESS_EXISTS"," BUSINESS_EXISTS" ),
    SYSTEM_ERROR("SYSTEM_ERROR", "system error" ),
    ;
    /**
     * 响应状态码
     */
    private String code;
    /**
     * 响应信息
     */
    private String message;

    ResultCodeEnum(String code, String msg) {
        this.code = code;
        this.message = msg;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
